* DATE 08/27/84  12:36
* edit.cmd
STOR CHR(PEEK (063)) TO dr
RECA
STOR lastname TO mlastname
STOR fname TO mfname
STOR spouse TO mspouse
STOR mr TO mmr
STOR title TO mtitle
STOR company1 TO mcompany1
STOR company2 TO mcompany2
STOR caddress TO mcaddress
STOR suite TO msuite
STOR ccity TO mccity
STOR cst TO mcst
STOR czip TO mczip
STOR address TO maddress
STOR apt TO mapt
STOR city TO mcity
STOR st TO mst
STOR zip TO mzip
STOR ophone TO mophone
STOR phone TO mphone
STOR dear TO mdear
STOR send TO msend
STOR cs1 TO mcs1
STOR cs2 TO mcs2
STOR cs3 TO mcs3
STOR cs4 TO mcs4
STOR cs5 TO mcs5
STOR cs6 TO mcs6
STOR update TO mupdate
ERAS
STOR 'Edit Data Module' TO mode
STOR 'Enter the new or corrected information' TO prompt1
STOR 'Control Q to end edit session' TO prompt2
@ 1,25 SAY mode
@ 2, 0 SAY "+---------------------------------------"
@ 2,39 SAY "---------------------------------------+"
@ 3, 3 SAY "Lastname"
@ 3,46 SAY "First & MI"
@ 4, 5 SAY "Spouse"
@ 4,46 SAY "Address as"
@ 6, 6 SAY "Title"
@ 7, 1 SAY "Company #1"
@ 8, 9 SAY "#2"
@ 9, 0 SAY "Co. Address"
@ 9,51 SAY "Suite"
@ 10, 7 SAY "City"
@ 10,36 SAY "ST"
@ 10,53 SAY "Zip"
@ 12, 2 SAY "Home Addr"
@ 12,53 SAY "Apt"
@ 13, 7 SAY "City"
@ 13,36 SAY "ST"
@ 13,53 SAY "Zip"
@ 14, 2 SAY "Telephone  Office"
@ 14,46 SAY "Home phone"
@ 15, 1 SAY "Salutation"
@ 15,42 SAY "Send to office"
@ 16, 3 SAY "Codes 1-"
@ 16,20 SAY "2-"
@ 16,31 SAY "3-"
@ 16,42 SAY "4-"
@ 16,54 SAY "5-"
@ 16,65 SAY "6-"
@ 17,50 SAY "Update"
@ 18, 0 SAY "+---------------------------------------"
@ 18,39 SAY "---------------------------------------+"
@ 19,12 SAY prompt1
@ 20,12 SAY prompt2
@ 3,12 GET mlastname
@ 3,57 GET mfname
@ 4,12 GET mspouse
@ 4,57 GET mmr
@ 6,12 GET mtitle
@ 7,12 GET mcompany1
@ 8,12 GET mcompany2
@ 9,12 GET mcaddress
@ 9,57 GET msuite
@ 10,12 GET mccity
@ 10,40 GET mcst picture '!!'
@ 10,57 GET mczip picture '99999'
@ 12,12 GET maddress
@ 12,57 GET mapt
@ 13,12 GET mcity
@ 13,40 GET mst picture '!!'
@ 13,57 GET mzip picture '99999'
@ 14,20 GET mophone picture '(999)999-9999'
@ 14,57 GET mphone picture '(999)999-9999'
@ 15,12 GET mdear
@ 15,57 GET msend picture '!'
@ 16,12 GET mcs1
@ 16,23 GET mcs2
@ 16,34 GET mcs3
@ 16,45 GET mcs4
@ 16,57 GET mcs5
@ 16,68 GET mcs6
@ 17,57 GET mupdate picture '99/99/99'
READ
CLEA GETS
DO CASE
CASE mfname = ' '
 STOR t TO error
CASE mmr = ' '
 STOR t TO error
CASE mdear = ' '
 STOR t TO error
CASE .NOT. (msend = 'Y' .OR. msend = 'N')
 STOR t TO error
OTHE
 STOR f TO error
ENDC
IF error
 @ 01,00
 @ 19,00
 @ 20,00
 @ 21,00
 @ 1,18 SAY 'Please Correct the Indicated Data'
 STOR t to an:error
 DO WHIL an:error
  DO CASE
  CASE mfname = ' '
   @ 20,15 SAY 'Must add a First Name                                  '
   @ 03,57 GET mfname
   READ
  CASE mmr = ' '
   @ 20,15 SAY 'Must have Mr. or Miss. etc                             '
   @ 04,57 GET mmr
   READ
  CASE mdear = ' '
   @ 20,15 SAY 'Must have a salutation for Dear.....                   '
   @ 15,12 GET mdear
   READ
  CASE .NOT. (msend = 'Y' .OR. msend = 'N')
   @ 20,15 SAY 'Must answer "Y" or "N" to send letter to office   '
   @ 15,57 GET msend picture '!'
   READ
  OTHE
   STOR f TO an:error
  ENDC
 ENDD while an:error
ENDI error
STOR 'N' TO command
@ 19,00
@ 20,00
@ 21,00
@ 20,15 SAY 'Are there any more changes ?                        '
@ 20,48 GET command picture '!'
READ
IF command = 'Y'
 @ 1,00
 @ 1,25 SAY mode
 @ 3,12 GET mlastname
 @ 3,57 GET mfname
 @ 4,12 GET mspouse
 @ 4,57 GET mmr
 @ 6,12 GET mtitle
 @ 7,12 GET mcompany1
 @ 8,12 GET mcompany2
 @ 9,12 GET mcaddress
 @ 9,57 GET msuite
 @ 10,12 GET mccity
 @ 10,40 GET mcst picture '!!'
 @ 10,57 GET mczip picture '99999'
 @ 12,12 GET maddress
 @ 12,57 GET mapt
 @ 13,12 GET mcity
 @ 13,40 GET mst picture '!!'
 @ 13,57 GET mzip picture '99999'
 @ 14,20 GET mophone picture '(999)999-9999'
 @ 14,57 GET mphone picture '(999)999-9999'
 @ 15,12 GET mdear
 @ 15,57 GET msend picture '!'
 @ 16,12 GET mcs1
 @ 16,23 GET mcs2
 @ 16,34 GET mcs3
 @ 16,45 GET mcs4
 @ 16,57 GET mcs5
 @ 16,68 GET mcs6
 @ 17,57 GET mupdate picture '99/99/99'
 @ 19,00
 @ 20,00
 @ 21,00
 @ 19,12 SAY prompt1
 @ 20,12 SAY prompt2
 READ
 CLEA GETS
ENDI command = 'Y'
REPL lastname WITH mlastname, fname WITH mfname
REPL spouse WITH mspouse, mr WITH mmr
REPL title WITH mtitle, company1 WITH mcompany1
REPL company2 WITH mcompany2, caddress WITH mcaddress
REPL suite WITH msuite
REPL ccity WITH mccity, cst WITH mcst
REPL czip WITH mczip, address WITH maddress
REPL apt WITH mapt
REPL city WITH mcity, st WITH mst
REPL zip WITH mzip, ophone WITH mophone
REPL phone WITH mphone, dear WITH mdear
REPL send WITH msend
REPL cs1 WITH mcs1, cs2 WITH mcs2
REPL cs3 WITH mcs3, cs4 WITH mcs4
REPL cs5 WITH mcs5, cs6 WITH mcs6
IF $(DATE(),1,2) <> '00'
 STOR 'Y' TO command
 @ 19,00
 @ 20,00
 @ 21,00
 @ 20,12 SAY 'Do You wish to UpDate to Todays Date (Y/N) ?'
 @ 20,57 GET command PICTURE '!'
 READ
 IF command = 'Y'
  REPL update WITH  DATE()
 ELSE
  REPL update WITH mupdate
 ENDI $(date)
ENDI command = 'Y'
RELE ALL
STOR '?' TO command
STOR t TO more
STOR t TO first
RETU
